<?php
include ("includes/header.php");
include ("includes/connection.php");
include ("includes/login.php");
include ("includes/iniciaSessio.php");
# Buscamos los mensajes privados
?>

	<body >
			<?php include("includes/contentHeader.php");
			include ("./includes/menuMissatges.php");
			$sql = "SELECT * FROM missatge WHERE de='" . $_SESSION['username'] . "' order by idMissatge";
$res = mysql_query($sql, $conexion) or die(mysql_error());
			?>
		<!--contingut 1-->
		<section class="container">
			<!--fons gris-->
			<div class="hero-unit">
				<table width="800" border="0" align="center" cellpadding="1" cellspacing="1">
	<tr>
		<td width="426" align="center" valign="top"><strong>Per</strong></td>
		<td width="321" align="center" valign="top"><strong>Assumpte</strong></td>
		<td width="321" align="center" valign="top"><strong>Data</strong></td>
	</tr>
	<?php
$i = 0;
while($row = mysql_fetch_assoc($res)){
	?>
	<tr bgcolor="<?php
if($i%2==0) 
{
	 echo "#FFE7CE"; 
} 
else 
{
	 echo "#FFCAB0"; 
}
	?>">
		<td align="center" valign="top"><a href="llegir_enviatsMissatges.php?id=<?php echo $row['idMissatge'] ?>"><?php echo $row['per'] ?></a></td>
		<td align="center" valign="top"><?php echo $row['assumpte'] ?></td>
		<td align="center" valign="top"><?php echo $row['data'] ?></td>
	</tr>
	<?php $i++;
		}
	?>
</table>
			</div>
			<!-- fi fons gris-->
		</section>
			<!-- fi contingut 1-->
		<!--contingut 2-->
		<section class="container">
			<div class="hero-unit"></div>
		</section>
<hr>
	<?php
	include ("includes/footer.php");
	?>
	<?php ?>